import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import store from './store';
import {Provider} from 'mobx-react';

ReactDOM.render(
  <React.StrictMode>
    {/* 方式一： 如果store/index.js是通过对象导出的，则可以用扩展运算符一次性传递多个子store模块 */}
    <Provider {...store}>
      <App />
    </Provider>

    {/* 方式二：如果store/index.js是通过class类导出的， 通过props传递store集合 */}
    {/* <Provider store={store}>
      <App />
    </Provider> */}
  </React.StrictMode>,
  document.getElementById('root')
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
